<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
    <title>Title</title>
</head>
<body>

<a href="${pageContext.request.contextPath}/user/viewCreate">新增</a>

<s:if test="userList == null || userList.size() == 0">
    没有数据
</s:if>
<s:else>
    <table border="1" cellpadding="0" cellspacing="0">
        <tr>
            <td>ID</td>
            <td>用户名</td>
            <td>密码</td>
<%--            <td>角色</td>--%>
            <td>操作</td>
        </tr>
        <s:iterator value="userList">
            <tr>
                <td>${id}</td>
                <td>${username}</td>
                <td>${password}</td>
<%--                <td>${role.name}</td>--%>
                <td>
                    <a href="${pageContext.request.contextPath}/user/viewUpdate?id=${id}">编辑</a>
                    <a href="${pageContext.request.contextPath}/user/delete?id=${id}">删除</a>
                </td>
            </tr>

        </s:iterator>
    </table>
</s:else>
</body>
</html>
